It calculates the drainage directions minimizing the deviation from the real flow. The deviation is calculated using a triangular construction
and it could be given in degrees (D8 LAD method) or as (trasversal distance (D8 LTD method). The deviation could be cumulated
along the path using the <i>lambda</i> parameter, and when it assumes a
limit value the flux is redirected towards the real gradient direction. If
the drainage network is known and marked in a raster matrix with the corresponding drainage directions, its flow directions can be kept fixed.
It is possible to run the model in two different ways, the standard and the one in which the drainage directions will be kept fixed on real data.
<br>
<br>
<h3>Inputs</h3>
<ul>      
<li>the file containing the matrix of elevations (obtained with pitfiller)</li>
<li>the file containing the old drainage direction matrix (obtained with
flowdirections)</li>
<li>if we choose to fix the network, the map containing the drainage
directions along the network</li>
</ul>
<br>
<br>
<h3>Output</h3>
<ul>      
<li>the file containing the new drainage directions</li> 
<li>the file containing the total contributing areas calculated with the new drainage directions</li> 
</ul>
<br>
<br>
<h3>Notes</h3>
The parameter <i>lambda</i> changes in the range from 0 (do not consider the upstream cumulated deviation) to 1 (consider all the upstream cumulated deviation).
<br>
The mode with fixed network only works with the LTD method of the program.
<br>
If the fixed network mode is selected the output TCA file is calculated considering the original drainage directions calculated with DrainDir, to have TCA
on the drainage directions considering the fixed network please run Tca separately with this as input flow map. 
